<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        function push(array, ...items) {
            items.forEach(function(item) {
                array.push(item);
                console.log(item);
            });
        }
        var a = [];
        push(a, 1, 2, 3)
    </script>
</body>
</html>